package com.kai.admin.exception;

import com.kai.common.exception.ErrorCode;
import lombok.Getter;
import org.springframework.security.core.AuthenticationException;

/**
 * <p>
 * 登录异常
 * </p>
 *
 * @author weijk
 * @since 2023/7/16
 */
public class LoginException extends AuthenticationException {

    private static final long serialVersionUID = 7443554933831160542L;

    @Getter
    private final int errorCode;

    public LoginException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.errorCode = errorCode.getCode();
    }

}
